feat: Implement restarter.stackable.tech/ignore label#410
feat: Implement restarter.stackable.tech/ignore label#410siegfriedweber wants to merge 10 commits intomainfrom
Conversation
…gmap.*" and "restarter.stackable.tech/ignore-secret.*"
sbernauer
left a comment
There was a problem hiding this comment.
Mostly nits, only one concern about the watcher and label
| authors = ["Stackable GmbH <info@stackable.tech>"] | ||
| license = "OSL-3.0" | ||
| edition = "2021" | ||
| edition = "2024" |
There was a problem hiding this comment.
I would have preferred a separate PR (as part of stackabletech/issues#832), but I followed https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html and ended up with nearly the same changes, so LGTM
|
|
||
| Label:: `restarter.stackable.tech/ignore` | ||
|
|
||
| If a ConfigMap or Secret is only used for initializing a StatefulSet or contains data which can be hot-reloaded, add the label `restarter.stackable.tech/ignore: "true"` to avoid unnecessary restarts of the StatefulSet pods: |
There was a problem hiding this comment.
| If a ConfigMap or Secret is only used for initializing a StatefulSet or contains data which can be hot-reloaded, add the label `restarter.stackable.tech/ignore: "true"` to avoid unnecessary restarts of the StatefulSet pods: | |
| If a ConfigMap or Secret is only used for initializing a StatefulSet or contains data which can be hot-reloaded, add the label `restarter.stackable.tech/ignore: "true"` to avoid unnecessary restarts of the StatefulSet Pods: |
| metadata_watcher( | ||
| cms, | ||
| watcher::Config::default() | ||
| .labels("restarter.stackable.tech/ignore != true"), |
There was a problem hiding this comment.
One thing that came up to my mind: What happens when users add or remove the label from a ConfigMap/Secret?
Will e.g. adding this label result in a stale version to be cached forever? Maybe this optimization is actually not worth it 🤷
| .filter(|annotation| { | ||
| annotation | ||
| .0 | ||
| .starts_with("restarter.stackable.tech/ignore-configmap.") | ||
| }) | ||
| .map(|x| x.1) |
There was a problem hiding this comment.
I misread .0 and .1 and was confused why we store the key. This is a idea how we could name them. Optional, feel free to ignore
(same below)
| .filter(|annotation| { | |
| annotation | |
| .0 | |
| .starts_with("restarter.stackable.tech/ignore-configmap.") | |
| }) | |
| .map(|x| x.1) | |
| .filter_map(|(key, value)| { | |
| key.starts_with("restarter.stackable.tech/ignore-configmap.") | |
| .then_some(value) | |
| }) |
There was a problem hiding this comment.
Or as an alternative
| .filter(|annotation| { | |
| annotation | |
| .0 | |
| .starts_with("restarter.stackable.tech/ignore-configmap.") | |
| }) | |
| .map(|x| x.1) | |
| .filter(|(key, _)| key.starts_with("restarter.stackable.tech/ignore-configmap.")) | |
| .map(|(_, value)| value) |
|
|
||
| ### Added | ||
|
|
||
| - Support the annotation `restarter.stackable.tech/ignore` on ConfigMaps and Secrets and the |
There was a problem hiding this comment.
| - Support the annotation `restarter.stackable.tech/ignore` on ConfigMaps and Secrets and the | |
| - Support the label `restarter.stackable.tech/ignore` on ConfigMaps and Secrets and the |
Description
Support the
restarter.stackable.tech/ignoreannotation on ConfigMaps and Secrets to exclude them from the restarter controller.Rust edition updated to version 2024 to be able to use if-let-chains.
Part of stackabletech/issues#837
Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecationlabel & add to the deprecation scheduletype/experimentallabel & add to the experimental features tracker